//
//  protocolViewController.m
//  xpkc
//
//  Created by TopSage on 15/12/10.
//  Copyright (c) 2015年 TopSage. All rights reserved.
//

#import "protocolViewController.h"
#import "MBProgressHUD.h"
@interface protocolViewController ()<UIWebViewDelegate>

@end

@implementation protocolViewController
{
    MBProgressHUD *hud;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor whiteColor];
    self.title=@"课程协议";
    UIWebView * webview =[[UIWebView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    webview.backgroundColor=[UIColor redColor];
    NSString * path =self.protocolURL;
    NSURL * url =[NSURL URLWithString:path];
    [webview loadRequest:[NSURLRequest requestWithURL:url]];
    webview.delegate=self;
    [self.view addSubview:webview];
    NSLog(@"%@",self.protocolURL);

}

-(void)webViewDidStartLoad:(UIWebView *)webView
{
    hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    hud.labelText = @"加载中";
}

-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    [hud hide:YES];
    
}
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    
    [hud hide:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
